﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_SP_Custome : System.Web.UI.Page
{
    private DataSet objDataSet;
    protected void Page_Load(object sender, EventArgs e)
    {
        string loaisp = Request.QueryString["loaisp"];
        string nsx = Request.QueryString["nsx"];
        // Load the grid only the first time the page is loaded
        if (!Page.IsPostBack)
        {
            BindGrid();
        }
    }
    // Populate the GridView with data
    private void BindGrid()
    {
        // Get CategoryID from the query string
        string loaisp = Request.QueryString["loaisp"];
        if (Request.QueryString["nsx"] == null)
            return;
        string nsx = Request.QueryString["nsx"];

        SanPhamBUS objSanPham = new SanPhamBUS(TGDDConfiguration.DbConnectionString);
        try
        {
            objDataSet = objSanPham.SelectSanPhamByLoaiSP_NSX(int.Parse(loaisp), int.Parse(nsx));
            grid.DataSource = objDataSet.Tables[0];
            grid.DataBind();
        }
        catch (System.Exception ex)
        {
            throw new Exception(ex.Message, ex.InnerException);
        }
    }

}
